package br.com.massai.model.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.ejb.Local;

import br.com.massai.model.exceptions.SystemException;
import br.com.massai.view.enums.SortOrder;

@Local
@SuppressWarnings({ "rawtypes" })
public interface GenericRepository<T> extends Serializable {
	
	public T create(T entity) throws SystemException;
	public T update(T entity) throws SystemException;
	public void delete(T entity) throws SystemException;
	public T findID(Long id) throws SystemException;
	public List<T> findAll() throws SystemException;
	public List<T> findNamedQuery(String namedQuery) throws SystemException;
	public List<T> findParameters(int offset, int length, Map<String, Object> parameters, StringBuilder clauseWhere) throws SystemException;
	List<T> loadPaginated(int first, int count, String sortField, SortOrder sortOrder, Map<String, Object> parameters, StringBuilder clauseWhere) throws SystemException;
	public List<T> findExamples(T entity) throws SystemException;
	public String getNamedQuery(String namedQuery, Class c) throws SystemException;
	public void setEntity(Class<T> entity) throws SystemException;
	public int count(Map<String, Object> parameters, StringBuilder clauseWhere) throws SystemException;

}
